package growSquarePrinter;

import java.awt.Rectangle;

public class growSquarePrinter {

	public static void main(String[] args) {
		
		// Define dimensions of Rectangle
		int length = 50;
		int width  = 50;
		
		// Create new Rectangle named square
		Rectangle square = new Rectangle(100, 100, length, width);
		

		// Grow and print square as many times as defined by repetitions
		for(int repetitions = 1; repetitions < 2; repetitions++)
		{
			// If repetitions is 1 print square prior to translation sequence
			if(repetitions == 1)
			{
				System.out.println(square);
			}
			
			square.grow((length / 2) * repetitions, (width / 2) * repetitions);
			square.translate((length / 2) * repetitions, (length / 2) * repetitions);
			System.out.println(square);
			
			//Refresh variables to current dimensions
			double lengthTemp = (double) length;
			lengthTemp = square.getWidth();
			length = (int) lengthTemp;
			
			double widthTemp = (double) width;
			widthTemp = square.getHeight();
			width = (int) widthTemp;
			

		}

	}

}